package com.kancy.springcloudconfig.util;

import java.awt.*;
import java.net.URI;

/**
 * <p>
 * CommonUtil
 * </p>
 *
 * @author: kancy
 * @date: 2019/10/26 14:23
 **/
public class CommonUtil {
    public static boolean isEmpty(Object obj){
        return obj == null || String.valueOf(obj).trim().length() == 0;
    }

    public static boolean isNotEmpty(Object obj) {
        return !isEmpty(obj);
    }

    public static void openURL(String sURL) {
        try {
            URI uri = new URI(sURL);
            Desktop desktop = null;
            if (Desktop.isDesktopSupported())
                desktop = Desktop.getDesktop();
            if (desktop != null)
                desktop.browse(uri);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
